package tinking.java.operator;

/**
 * @author GaoFeng
 * @date 2019/12/24 20:13
 */
public class Literals {

    public static void main(String[] args) {

        int i1 = 0x2f; // 十六进制（小写）
        System.out.println("i1: " + Integer.toBinaryString(i1));

        int i2 = 0x2F; // 十六进制（大写）
        System.out.println("i2: " + Integer.toBinaryString(i2));

        int i3 = 0177; // 八进制数
        System.out.println("i3: " + Integer.toBinaryString(i3));

        char c = 0xffff; // 字符的最大值
        System.out.println("c: " + Integer.toBinaryString(c));


        byte b = 0x7f; // 一个字节最大能存放的数
        System.out.println("b: " + Integer.toBinaryString(b));

        short s = 0x7fff;
        System.out.println("s: " + Integer.toBinaryString(s));


        long n1 = 200L; // long suffix
        long n2 = 200L; // long suffix
        long n3 = 200;

        float f1 = 1;
        float f2 = 1F; // float suffix
        float f3 = 1f; // float suffix

        double d1 = 1d; // double suffix
        double d2 = 1D; // double suffix

        // (Hex and Octal also work with long)

    }
}
